package com.lagou.ex.mybatis.base.mapper;

import com.lagou.ex.mybatis.base.model.UserModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface UserMapper {

    /**
     * 根据手机号码查询
     *
     * @param phone 手机号码
     * @return 用户列表
     */
    List<UserModel> queryByPhone(@Param("phone") String phone);

    List<UserModel> queryByName(@Param("name") String name);

    List<UserModel> queryById(@Param("id") String id);


    List<UserModel> queryByPortrait();

    int insertUser(UserModel user);

    int deleteById(Integer id);

    int deleteByPhone(String phone);

    int updateById(@Param("id") Integer id, @Param("portrait") String portrait);

    int updateById2(@Param("id") Integer id, @Param("regIp") String regIp);
    int insertUser2(UserModel user);


}

